<template>
  <div class="mybooking">
    <!--<div class="top">-->
      <!--<div class="top_son">-->

        <!--<div class="top_son_item J_center">-->
          <!--<div class="_num">-->
            <!--0-->
          <!--</div>-->
          <!--<div class="_font">-->
            <!--累计训练/次-->
          <!--</div>-->
        <!--</div>-->

        <!--<div class="J_center">-->
          <!--<img style="width: 1px; height: 80px;">-->
        <!--</div>-->

        <!--<div class="top_son_item J_center">-->
          <!--<div class="_num">-->
            <!--0-->
          <!--</div>-->
          <!--<div class="_font">-->
            <!--累计时长/分钟-->
          <!--</div>-->
        <!--</div>-->

        <!--<div class="J_center">-->
          <!--<img style="width: 1px; height: 80px;">-->
        <!--</div>-->

        <!--<div class="top_son_item J_center">-->
          <!--<div class="_num">-->
            <!--0-->
          <!--</div>-->
          <!--<div class="_font">-->
            <!--累计天数-->
          <!--</div>-->
        <!--</div>-->

      <!--</div>-->
    <!--</div>-->
    <div>
      <div class="BookingGo" v-show="Schedule.length === 0">
        <div class="BookingGo_son">
          <div class="BookingGo_grandson" @click="gobooking">
            果断去约课
          </div>
        </div>
      </div>
      <div class="courseList">
        <div class="box" v-for="item in Schedule">
          <router-link :to="{ name: '' }">
            <div class="left">
              <img src="../../assets/images/default.png">
            </div>
            <div class="center">
              <h2>{{item.Schedule.data.Course.data.title}}</h2>
              <p class="p2"><span>{{item.Schedule.data.Trainer.data.name}}</span></p>
              <p class="p3"><span class="time">{{week[item.Schedule.data.weekday]}}</span>&nbsp;<span>{{item.Schedule.data.weekday_time}}</span></p>
            </div>
            <div class="right">
              <div class="_14rKO">
                <div>已预约</div>
              </div>
            </div>
          </router-link>
        </div>
      </div>
    </div>
    <div class="null"></div>
    <footer-in></footer-in>
  </div>
</template>

<script>
  import FooterIn from '@/components/footer.vue'
  import { requestOrders } from '../../api/api'

  export default {
    data () {
      return {
        Schedule: [],
        week: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
      }
    },
    components: { FooterIn },
    mounted () {
      this.$nextTick(() => {
        this.lodaOder()
      })
    },
    methods: {
      gobooking () {
        this.$router.push({ name: 'classList' })
      },
      lodaOder () {
        let e = this
        requestOrders({}).then((res) => {
          e.Schedule = res.data.data
        })
      }
    }
  }
</script>

<style scoped lang="less">
  @subject:#e61b64;
  .mybooking {
    background: #333;
    height: 100%;
    /*padding-bottom: 0.49rem;*/
  }

  ._1N9N7, .J_center {
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
  }

  .top_son {
    height: 1.14rem;
    background-color: #1f1f1f;

    .top_son_item {
      -webkit-flex: 1;
      -ms-flex: 1;
      flex: 1;
      -webkit-align-items: center;
      -ms-flex-align: center;
      align-items: center;
      -webkit-flex-direction: column;
      -ms-flex-direction: column;
      flex-direction: column;
      overflow: hidden;
      font-family: DINPro-Condensed,DINPro-Regular,sans-serif;

      ._num {
        color: @subject;
        font-weight: 900;
        font-size: 0.41rem;
      }

      ._font {
        color: #737272;
        font-size: 0.1rem;
        margin-top: 0.1rem;
      }
    }
  }

  .top_son, .top_son .top_son_item {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
  }

  .courseList{
    width: 100%;
  }

  .box{
    width: 100%;
    a{
      width: 100%;
      display: block;
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      -webkit-justify-content: space-between;
      -ms-flex-pack: justify;
      justify-content: space-between;
      min-height: 92px;
      background-color: #1c1c1c;
      border: 1px solid #2e2e2c;
    }
    .left{
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      -webkit-align-items: center;
      -ms-flex-align: center;
      align-items: center;
      img{
        border-radius: 50%;
        width: 0.6rem;
        height: 0.6rem;
        overflow: hidden;
        margin-left: 0.07rem;
        margin-right: 0.15rem;
      }
    }
    .center{
      -webkit-flex: 1;
      -ms-flex: 1;
      flex: 1;
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      -webkit-justify-content: space-between;
      -ms-flex-pack: justify;
      justify-content: space-between;
      width: 0.04rem;
      -webkit-flex-direction: column;
      -ms-flex-direction: column;
      flex-direction: column;
      h2{
        color: #fff;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        font-weight: 400;
        font-size: 0.15rem;
        line-height: 0.2rem;
        margin-right: 0.1rem;
        margin-top: 0.14rem;
      }
      .p2{
        margin-top: 0.1rem;
        margin-bottom: 0.1rem;
        font-size: 0.11rem;
        color: #999;
        opacity: .9;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        line-height: 0.15rem;
        span{
          display: block;
          white-space: nowrap;
        }
      }
      .p3{
        color: #d7d7d7;
        font-size: 0.11rem;
        white-space: nowrap;
        margin-bottom: 0.14rem;
        .time{
          font-size: 0.11rem;
          color: @subject;
        }

      }
    }
    .right{
      flex-direction: column;
      align-items: center;
      -ms-flex-pack: center;
      justify-content: center;
      display: flex;
      position: relative;
      width: 0.5rem;
      ._1zwdp{
        width: 0.34rem;
        height: 0.34rem;
        position: absolute;
        top: 0;
        right: 0;
        text-align: center;
        color: pink;
        clip-path: polygon(0 0,70% 0,100% 30%,100% 100%);
        -webkit-clip-path: polygon(0 0,70% 0,100% 30%,100% 100%);
        background-image: linear-gradient(90deg,#df1b6b,#a61ba3);
        display: flex;
        justify-content: center;
        align-items: center;
        div{
          transform: rotate(45deg);
          -webkit-transform: rotate(45deg);
          padding-bottom: 0.14rem;
          padding-left: 0.02rem;
          font-size: 9px;
          overflow: hidden;
          padding-top: 0;
          line-height: 0.09rem;
        }
      }
      ._14rKO{
        width: 0.4rem;
        height: 0.25rem;
        margin-right: 0.1rem;
        div{
          width: 0.4rem;
          height: 0.25rem;
          line-height:0.25rem;
          text-align: center;
          border: 1px solid @subject;
          color: @subject;
          font-size:0.12rem;
        }
      }
    }
  }

  .BookingGo {
    height: 1rem;
  }

  .BookingGo {
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
  }

  .BookingGo{
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
  }

  .BookingGo{
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
  }

  .BookingGo .BookingGo_son {
    height: 0.4rem;
    width: 1.4rem;
  }

  .BookingGo_grandson {
    color: @subject;
    border-color: @subject;
    border-radius: 0.02rem;
    font-size: 0.17rem;
  }

  .BookingGo_grandson {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    height: 100%;
    width: 100%;
    font-size: 0.17rem;
    box-sizing: border-box;
    font-weight: 500;
  }

  .BookingGo_grandson {
    border-radius: 0.02rem;
    border-style: solid;
    border-width: 1px;
  }
  .null{
    width: 100%;
    height: 0.49rem;
  }
</style>
